// ==UserScript==
// @name         AcFun小助手
// @namespace    https://github.com/maijz128
// @version      0.1
// @description  自动原画
// @author       MaiJZ
// @match        *://www.acfun.cn/v/ac*
// @grant        none
// ==/UserScript==

const player_view_homura_swf = 'http://maijz.gitee.io/acfun/flash/player-view-homura.swf';

(function () {
    'use strict';

    const url = location.href;
    const query = '#player > object';
    var obj = document.querySelector(query);
    if (obj) {
        console.log("找到播放器");

        // obj.setAttribute('data', player_view_homura_swf);
    }

    // const quality
    const query_flashvars = '#player > object param[name="flashvars"]';
    const flashvars = document.querySelector(query_flashvars);
    if (flashvars){
        console.log("flashvars");
        var value = flashvars.getAttribute('value');
        value += '&quality=0';
        flashvars.setAttribute('value', value);

        const data =  obj.getAttribute('data');
        obj.setAttribute('data', data);
    }

})();

